package team.knowers.qzhserver.course.course.entity.dao;

import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import team.knowers.qzhserver.common.entity.BaseDO;

import java.io.Serial;
import java.util.Date;

/**
 * 课程course表对应实体类
 * @author xtg
 * @date 2024/1/19 15:35
 */

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(CourseDOField.TABLE_NAME)
public class CourseDO extends BaseDO {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 课程id
     */
    @TableId(value = CourseDOField.ID, type = IdType.ASSIGN_ID)
    private String id;
    /**
     * 课程名
     */
    @TableField(CourseDOField.NAME)
    private String name;

    /**
     * 课程创建者id
     */
    @TableField(CourseDOField.USER_ID)
    private String userId;
    /**
     * 课程封面
     */
    @TableField(CourseDOField.COVER)
    private String cover;
    /**
     * 课程所属专业id
     */
    @TableField(CourseDOField.SUBJECT_ID)
    private String subjectId;
    /**
     * 课程描述
     */
    @TableField(CourseDOField.DESCRIPTION)
    private String description;
    /**
     * 课程创建时间
     */
    @TableField(value = CourseDOField.GMT_CREATE, fill = FieldFill.INSERT)
    private Date gmtCreate;
    /**
     * 课程编辑时间
     */
    @TableField(value = CourseDOField.GMT_MODIFIED, fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;
    /**
     * 课程售价
     */
    @TableField(CourseDOField.PRICE)
    private Double price;
    /**
     * 课程是否允许试看
     */
    @TableField(CourseDOField.TRY_SEE)
    private Boolean trySee;
    /**
     * 课程销量
     */
    @TableField(CourseDOField.SALES_VOLUME)
    private Integer salesVolume;
    //TODO：VO和DTO相关转换
    /**
     * 课程状态，0为编辑中，1为送审中，2为通过
     */
    @TableField(CourseDOField.STATUS)
    private Integer status;
}
